﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="page.asp"-->
<%
request_from=request("from")
request_to=request("to")
if request_from="" then
request_from=date
end if
if request_to="" then
request_to=date
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>列表管理</title>
<link href="images/style.css" type="text/css" rel="stylesheet" />
<script src="WdatePicker.js" language="javascript"></script>
<script>
function changeShowDate(){
var f = new Date(document.getElementById('from').value.replace(/\-/g, "\/"));
var t = new Date(document.getElementById('to').value.replace(/\-/g, "\/"));        
if(f > t) {
	alert("结束日期不能小于开始日期！");
    return false;
} 
var f1 = document.getElementById('from').value;
var t1 = document.getElementById('to').value;

window.location.href="/admin/Traffic_stat.asp?from="+f1+"&to="+t1;
}
function changeShowProvince(){
var c = document.getElementById("sel_Province").value;
window.location.href="/admin/admin_Traffic_Stat_Province.asp?Province="+c;
}
</script>
<style type="text/css">
<!--
.STYLE1 {color: #3F89F8}
-->
</style>
</head>
<body>
<table width="95%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
  
  <tr>
<td colspan="2" bgcolor="#FFFFFF">
              <%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct (year(datetime) &'-'& month(datetime) &'-'& day(datetime)) as aa from Traffic_Stat order by year(datetime) &'-'& month(datetime) &'-'& day(datetime) " 
'convert(datetime, convert(char(10),inputdate,120)) as Date

'response.write (exec)
rs.open exec,conn,1,1 
if rs.eof then
response.Write "&nbsp;暂无数据！"
response.end
else
rs.PageSize =10 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if	
%>
              <%For i=1 To x%>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="cedced" style="font-family : sans-serif;">
              <tr>
                <td height="25"><strong>日期：</strong><span class="Traffic_Stat_blue1"><%=rs("aa")%></span></td>
                <td width="5%" height="25" align="center">
                <a href="javascript:if(confirm('确定要删除该日期的所有记录吗?')){window.location.href='admin_Traffic_stat_delete.asp?t=date&id=<%=rs("aa")%>';}else{}">删除</a></td>
              </tr>
            </table>
<%rs.movenext
next
%>
<%end if%></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><%'以下显示分页
 call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
rs.close
set rs=nothing
%>
    <%
					dim Time1,Time2,Time3,Time4,Time5,Time6,Time7,Time8,Time9,Time10,Time11,Time12,Time13,Time14,Time15,Time16,Time17,Time18,Time19,Time20,Time21,Time22,Time23,Time24
						Time1=0:Time2=0:Time3=0:Time4=0:Time5=0:Time6=0:Time7=0:Time8=0:Time9=0:Time10=0:Time11=0:Time12=0:Time13=0:Time14=0:Time15=0:Time16=0:Time17=0:Time18=0:Time19=0:Time20=0:Time21=0:Time22=0:Time23=0:Time24=0
					set rs=server.createobject("adodb.recordset") 
					exec="select * from Traffic_Stat where datetime like '%"&request_Date&"%'" 
					rs.open exec,conn,1,1 
					do while not rs.eof
					dim hours
					hours = hour(rs("datetime"))
					select case hours
					case 0
						Time1=Time1+1
					case 1
						Time2=Time2+1					
					case 2
						Time3=Time3+1					
					case 3
						Time4=Time4+1					
					case 4
						Time5=Time5+1					
					case 5
						Time6=Time6+1					
					case 6
						Time7=Time7+1					
					case 7
						Time8=Time8+1					
					case 8
						Time9=Time9+1
					case 9
						Time10=Time10+1					
					case 10
						Time11=Time11+1					
					case 11
						Time12=Time12+1					
					case 12
						Time13=Time13+1					
					case 13
						Time14=Time14+1					
					case 14
						Time15=Time15+1					
					case 15
						Time16=Time16+1					
					case 16
						Time17=Time17+1			
					case 17
						Time18=Time18+1					
					case 18
						Time19=Time19+1					
					case 19
						Time20=Time20+1					
					case 20
						Time21=Time21+1					
					case 21
						Time22=Time22+1					
					case 22
						Time23=Time23+1					
					case 23
						Time24=Time24+1	
					end select			
					'response.write (Time12) & "_"
					rs.movenext
					loop
					rs.close
					set rs = nothing
				%></td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<% 
if Request.QueryString("xiugaipx")="ok" then
id=request("id") 
sql="select * from about where id="&id 
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
IF not isNumeric(request("px_id")) then
response.write("<script>alert(""排序ID必须为数字！""); history.go(-1);</script>")
response.end
end if
rs("px_id")=request.form("px_id") 
rs.update 
rs.close 
response.Write("<script language=""javascript"">alert(""修改排序成功！"");window.location.href='Manage_About.asp';</script>")
end if
%> 
<%
if request("act")="del" then
	id=request("id")
	if id="" then
	Response.Write "<script language='javascript'>alert('参数错误!');document.location.href('Manage_About.asp');</script>"
	Response.End()
	end if
set rs=server.createobject("adodb.recordset")
rs.open "Select * from about where id="&Request("id"),conn,1,3
if rs.bof and rs.eof then
	Response.Write "<script language='javascript'>alert('数据库中没有该记录！');document.location.href('Manage_About.asp');</script>"
	Response.End()
else
	rs.Delete
	rs.Update
	Response.Write "<script language='javascript'>alert('成功删除指定的信息！');document.location.href('Manage_About.asp');</script>"
end if
end if
%>
